/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.matrimonybeans;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.Stateless;

/**
 *
 * @author 4410s
 */
@Stateless
public class UpdatePayment implements UpdatePaymentLocal {

    Connection conn;
    ResultSet rs = null;
    boolean flag = false;

    @Override
    public boolean Update_Payment_Data(int id_services, String username, String card_types, String card_number, String status,String username_admin,int id) {
        try {
            ConnectDB conDB = new ConnectDB();
            conn = conDB.getConnection();
            String strSql = " Update ServicesDetails set id_services= ?, username=?,card_types=?,card_number=?,status=?,username_admin=? where id= ? ";
            PreparedStatement pstmt = conn.prepareCall(strSql);
           
            
            pstmt.setInt(1, id_services);
            pstmt.setString(2, username);
            pstmt.setString(3,card_types);
            pstmt.setString(4,card_number);
            pstmt.setString(5,status);
            pstmt.setString(6,username_admin);

            pstmt.setInt(7,id);

            int count;
            count = pstmt.executeUpdate();
            if (count > 0) {
                flag = true;
            } else {
                flag = false;
            }




        } catch (SQLException ex) {
            Logger.getLogger(UpdatePayment.class.getName()).log(Level.SEVERE, null, ex);
        }
        return flag;
    }
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
}
